% 04/02/2012
function [ cc ] = myColorCoding( field )
n = size( field, 1 );
cc = zeros(n, 3 );

max = fieldMAX( field );
min = fieldMIN( field );

for i = 1:n
    cc(i, :) = [ field(i) - min, 0.3922, max - field(i) ]; 
end % for

cc(:, :) = int8( cc(:, :) * 255 );

end % function

function [max] = fieldMAX( field )
n = size( field, 1);
max = -Inf;
for i = 1:n
    if ( field(i) > max )
        max = field(i);
    end % if
end % for
end % function fieldMAX

function [min] = fieldMIN( field )
n = size( field, 1 );
min = Inf;
for i = 1:n
    if ( field(i) < min )
        min = field(i);
    end % if
end % for
end % function fieldMIN

